package thread;

public class demo15 {
    public static void main(String[] args) throws InterruptedException {
        Thread t =  new Thread(() -> {
            while (true) {
                //
            }
        });
        System.out.println(t.getState() + " isAlive: " + t.isAlive()); // NEW isAlive: false
        t.start(); // 启动线程
        System.out.println(t.getState() + " isAlive: " + t.isAlive()); 
        t.join();
        System.out.println(t.getState() + " isAlive: " + t.isAlive()); // RUNNABLE isAlive: true
    }
}
